// Copyright 叶湘 ( weixin:yexiang841, email:yexiang841@qq.com ), Shitouren Studio. All Rights Reserved.

#include "PlayerController/Q3D_CPPA_PlayerController.h"
#include "Blueprint/UserWidget.h"
#include "Logger/Q3D_CPPU_Logger.h"

AQ3D_CPPA_PlayerController::AQ3D_CPPA_PlayerController()
{
    Q3D_LOG(Display, "PlayerController_Constructed");
}

AQ3D_CPPA_PlayerController::~AQ3D_CPPA_PlayerController()
{
}

void AQ3D_CPPA_PlayerController::Q3D_F_InputMode_Set_To_HUD_Implementation(UWidget *ptr_w_to_foces, bool bool_show_mouse_cursor, bool &bool_success, FString &string_log)
{
    if (ptr_w_to_foces == nullptr)
    {
        bool_success = false;
        string_log = "Null_Widget_To_Show";
        return;
    }
    FInputModeGameAndUI InputMode_GameAndUI;
    InputMode_GameAndUI.SetWidgetToFocus(ptr_w_to_foces->GetCachedWidget());
    InputMode_GameAndUI.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock);
    InputMode_GameAndUI.SetHideCursorDuringCapture(true);
    this->SetInputMode(InputMode_GameAndUI);
    this->SetShowMouseCursor(bool_show_mouse_cursor);
    bool_success = true;
    string_log = "";
}

void AQ3D_CPPA_PlayerController::Q3D_F_InputMode_Set_To_Game_Implementation(bool bool_show_mouse_cursor, bool &bool_success, FString &string_log)
{
    FInputModeGameOnly InputMode_GameOnly;
    this->SetInputMode(InputMode_GameOnly);
    this->SetShowMouseCursor(bool_show_mouse_cursor);
    bool_success = true;
    string_log = "";
}

void AQ3D_CPPA_PlayerController::Q3D_IF_Pawn_Possessed_Implementation(APawn *ptr_a_pawn, bool &bool_success, FString &string_log)
{
}
